package com.infosys.cabplanningdao.driver.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.infosys.cabplanning.common.domain.Driver;

public class DriverRowMapper implements RowMapper<Driver>{
	public Driver mapRow(ResultSet rs, int rowNum) throws SQLException {
		Driver driver = new Driver();
		driver.setDriverId(rs.getInt("driver_id"));
		driver.setDrivingLicenseNumber(rs.getString("dl_no"));
		driver.setFirstName(rs.getString("first_name"));
		driver.setLastName(rs.getString("last_name"));
		driver.setPhoneNumber(rs.getString("phone"));
		return driver;
	}
}
